﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

/* ==============================================================================
   * 功能描述：BoolToVisibilityConverter  
   * 创 建 者：Administrator
   * 创建日期：2022-04-06 08:18:56
   * ==============================================================================*/
namespace Zy.WPF.CtrLib.Converts
{
    /// <summary>
    /// 布尔转可访问类型
    /// </summary>
    public class BoolToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value)
            {
                return Visibility.Visible;
            }
            else
            {
                return Visibility.Collapsed;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}
